<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>控制台</title>
<jsp:include page="../header.jsp"></jsp:include>
<script type="text/javascript">
	var uid = 0;
</script>
<style type="text/css">
.backcolor{
background-color: #5cacee;
}

</style>
</head>

<body>
	<div class="contextBox">
		<form id="itemsForm" action="" method=get>
			<table class="TableList" width="100%" align="center">
		                          <tbody><tr class="TableContent">
									  <td align="left"><span style="width: 100px;text-align: right;">用户名称：</span><input type="text"
											name="userName" class="userName" value="">
											</td>
											</tr>
											<tr>
											<td>
											<span style="width: 400px;text-align: right;">密码： </span> <input
											type="text" name="password" class="password" value="">
											</td>
											</tr>
											<tr>
											<td>
											<span class="redtxt">手机号： </span> <input
											type="text" name="mobile" class="mobile" value="">
										</td>
									</tr>
									<tr>
										<td align="left"><span class="redtxt">登录状态： </span> <select
											name="isFincing" onchange="">
												<c:choose>
													<c:when test="${mapManager['islogin'] == 1}">
														<option value="1" selected="selected">允许登录</option>
													</c:when>
													<c:otherwise>
														<option value="1">允许登录</option>
													</c:otherwise>
												</c:choose>
												<c:choose>
													<c:when test="${mapManager['islogin'] == 2}">
														<option value="2" selected="selected">不允许登录</option>
													</c:when>
													<c:otherwise>
														<option value="2">不允许登录</option>
													</c:otherwise>
												</c:choose>
										</select>
										</td>
										</tr>
										<tr>
										<td>
										<span class="redtxt">赋给权限： </span> <select
											id="roleID" name="roleID">
												<option value='0'>请选择</option>
												<c:forEach items="${nrList}" var="u">
													<option <c:if test='${roleID==u.keyI }'>selected</c:if>
														value="${u.keyI}">${u.valueX}</option>
												</c:forEach>
										</select></td>
									</tr>
								</table>
								<table width="100%" border="0" cellspacing="0" cellpadding="0">
									<td align="left"><input type="button" value="提交"
											class="btn btn-success" onclick="addform()"></td>
								</table>

							</form>
						</div>
		
		<script type="text/javascript">
		function addform(){
			$.ajax({ type : 'post',
						url : "<%=request.getContextPath()%>/supervise/getManagerI.do",
						data : $("#itemsForm").serialize(),
						success : function(data) {
							if(data>0){
								alert("用户插入成功");
							}else if(data=0){
								alert("用户插入失败");
							}else{
								alert("用户,或手机号已存在");
							}
								
						}
					});
		}
	</script>
	
</body>

</html>